package com.example.itemreader.fromdb;

import com.example.pojo.User;
import org.springframework.batch.item.ItemWriter;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author XieYa
 */
@Component
public class DbJdbcWriter implements ItemWriter<User> {

    @Override
    public void write(List<? extends User> list) throws Exception {
        for (User user : list) {
            System.out.println(user.getId() + ":" + user.getUsername());
        }
        System.out.println("---");
    }
}
